<?php
namespace app\common\exception;
use app\common\enum\ErrorCodeEnum;
use app\common\enum\HttpCodeEnum;

/**
 * 用户参数类异常错误
 */
class ErrorTest extends BaseException {
    public $code;
    public $msg;
    public $error_code;
    public $content;

    public function __construct(array $params = [])
    {
        $this->code = isset($params['code']) && $params['code'] ? $params['code'] : HttpCodeEnum::CODE_500;
        $this->msg = isset($params['msg']) && $params['msg'] ? $params['msg'] : '错误测试';
        $this->error_code = isset($params['error_code']) && $params['error_code'] ? $params['error_code'] : ErrorCodeEnum::USER;
        $this->content = isset($params['content']) && $params['content'] ? $params['content'] : '';
        parent::__construct($params);
    }
}